﻿using System.Collections;

namespace Framework.UI.Template.Common
{
    public class QueryHelper
    {
        public static void SetQueryParameters(Hashtable table, string tableName, string fields, string orderFields,
                                              int pageSize, int pageNumber, OrderType orderType, string selectCondition)
        {
            table.Clear();

            table.Add("TableName", tableName);
            table.Add("SelectFields", fields);
            table.Add("OrderByField", orderFields);
            table.Add("PageSize", pageSize);
            table.Add("PageIndex", pageNumber);
            table.Add("SelectCondition", selectCondition);
            table.Add("RecordsCount", 0);
            table.Add("OrderType", orderType == OrderType.Asc ? 0 : 1);
        }
    }
}